package com.miracle9.game.dao;

import com.miracle9.game.entity.OnlineCount;

import java.util.List;

import org.springframework.stereotype.Repository;

@Repository
public class OnlineCountServiceDao extends SqlOperating<OnlineCount, Integer> {

    public void addOnlineCount(OnlineCount onlineCount) {
        save(onlineCount);
    }

    public List<OnlineCount> getOnlineCountsBy(String startDate, String endDate, int type) {
        return q_CreateSqlList("from OnlineCount where type=? and datetime>=? and datetime<? order by id desc", new Object[]{type, startDate, endDate});
    }

    public List<OnlineCount> getOnlineCountsBy(String startDate, String endDate) {
        return q_CreateSqlList("from OnlineCount where datetime>=? and datetime<? order by id desc", new Object[]{startDate, endDate});
    }

}
